x86: Clean up boot/wakeup code.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 10 Dec 2007 11:34:02 +0000 (11:34 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 10 Dec 2007 11:34:02 +0000 (11:34 +0000)
 * Generalise wakeup stack to general 'early stack' used everywhere.
 * Ensure things that must be aligned are aligned.
 * Remove some unused symbols.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/boot/head.S
xen/arch/x86/boot/trampoline.S
xen/arch/x86/boot/video.S
xen/arch/x86/boot/wakeup.S

index 775c89a45b58b6c716c312e1dfd0611bb970ed5b..e00659f710941b582f538e3720d6039e81098c28 100644 (file)
@@ -168,7 +168,7 @@ __start:
         mov     $trampoline_end - trampoline_start,%ecx
         rep     movsb
 
-        mov     $0x90000,%esp
+        mov     $bootsym_phys(early_stack),%esp
         call    cmdline_parse_early
 
         /* Jump into the relocated trampoline. */
@@ -180,7 +180,6 @@ __start:
         .globl trampoline_start, trampoline_end
 trampoline_start:
 #include "trampoline.S"
-#include "wakeup.S"
 trampoline_end:
 
         .text
index 6ffaa811ef94b0f8421d0bf6372d135234927921..2c92dc6a000ee7084bb02dbe15ddd5c5c00e0590 100644 (file)
@@ -150,8 +150,8 @@ trampoline_boot_cpu_entry:
         mov     %ax,%es
         mov     %ax,%ss
 
-        /* Stack grows down from +0x3000. Initialise IDT and enable irqs. */
-        mov     $0x3000,%sp
+        /* Initialise stack pointer and IDT, and enable irqs. */
+        mov     $bootsym(early_stack),%sp
         lidt    bootsym(rm_idt)
         sti
 
@@ -202,3 +202,8 @@ rm_idt: .word   256*4-1, 0, 0
 #include "mem.S"
 #include "edd.S"
 #include "video.S"
+#include "wakeup.S"
+
+        .align  16
+        .fill   PAGE_SIZE,1,0
+early_stack:
index b1fe52c56c1bb52328a29fd7ad67449315c9cd67..ad6514ebf0dcf8fe8de62a14e0760c7613f561de 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "video.h"
 
-/* Scratch space layout: +0x3000 to +0x4000. */
-#define modelist       (0x3000)                  /* 2kB (256 entries) */
+/* Scratch space layout: trampoline_end to trampoline_end+0x1000. */
+#define modelist       bootsym(trampoline_end)   /* 2kB (256 entries) */
 #define vesa_glob_info (modelist + 0x800)        /* 1kB */
 #define vesa_mode_info (vesa_glob_info + 0x400)  /* 1kB */
 
index 51a6ffa07e90cea3a246f212468d6e52dd42ab91..a986b422f8c090ef4b8e7034eeb144fa1ebf08dc 100644 (file)
@@ -1,12 +1,9 @@
         .code16
 
-#undef wakesym
-/* Used in real mode, to cal offset in current segment */
 #define wakesym(sym) (sym - wakeup_start)
 
+        .align 16
 ENTRY(wakeup_start)
-        wakeup_code_start = .
-
         cli
         cld
 
@@ -14,7 +11,7 @@ ENTRY(wakeup_start)
         movw    %cs, %ax
         movw    %ax, %ds
         movw    %ax, %ss        # A stack required for BIOS call
-        movw    $wakesym(wakeup_stack), %sp
+        movw    $wakesym(early_stack), %sp
 
         pushl   $0              # Kill dangerous flag early
         popfl
@@ -117,7 +114,7 @@ wakeup_32:
         mov     $BOOT_DS, %eax
         mov     %eax, %ds
         mov     %eax, %ss
-        mov     $bootsym_phys(wakeup_stack), %esp
+        mov     $bootsym_phys(early_stack), %esp
 
         # check saved magic again
         mov     $sym_phys(saved_magic), %eax
@@ -203,10 +200,3 @@ ret_point:
 bogus_saved_magic:
         movw    $0x0e00 + 'S', 0xb8014
         jmp     bogus_saved_magic
-
-        .align  16
-wakeup_stack_begin:     # Stack grows down
-
-        .fill   PAGE_SIZE,1,0
-wakeup_stack:           # Just below end of first page in this section
-ENTRY(wakeup_end)